package cn.lingnan.dao;

import cn.lingnan.entity.DdList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class OrderDao {

    @Autowired
    private MongoTemplate mongoTemplate;

    public List<DdList> findOrderLimit(){
        Query query=new Query();
        query.addCriteria(Criteria.where("")).limit(5);
        List<DdList> ordersLists = mongoTemplate.find(query, DdList.class);
        return ordersLists;
    }

}
